Integrand size = 37, antiderivative size = 253 \[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}-\frac {(C-A n+C n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}-n,-n,1-n,-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right ) \sec ^{1-n}(c+d x) \left (\frac {1+\sec (c+d x)}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a+a \sec (c+d x))^n \sin (c+d x)}{d n (1+n) (1+\sec (c+d x))}+\frac {2^{\frac {3}{2}+n} C \operatorname {AppellF1}\left (\frac {1}{2},1+n,-\frac {1}{2}-n,\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d} \]
[Out]
Time = 0.57 (sec) , antiderivative size = 253, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.162, Rules used = {4172, 4108, 3913, 3910, 134, 138} \[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=-\frac {(-A n+C n+C) \sin (c+d x) \sec ^{1-n}(c+d x) \left (\frac {\sec (c+d x)+1}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a \sec (c+d x)+a)^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2}-n,-n,1-n,-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right )}{d n (n+1) (\sec (c+d x)+1)}+\frac {A \sin (c+d x) \sec ^{-n}(c+d x) (a \sec (c+d x)+a)^n}{d (n+1)}+\frac {C 2^{n+\frac {3}{2}} \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac {1}{2}} (a \sec (c+d x)+a)^n \operatorname {AppellF1}\left (\frac {1}{2},n+1,-n-\frac {1}{2},\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right )}{d} \]
[In]
[Out]
Rule 134
Rule 138
Rule 3910
Rule 3913
Rule 4108
Rule 4172
Rubi steps \begin{align*} \text {integral}& = \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {\int \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n (a A n+a C (1+n) \sec (c+d x)) \, dx}{a (1+n)} \\ & = \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {C \int \sec ^{-n}(c+d x) (a+a \sec (c+d x))^{1+n} \, dx}{a}+\left (-C+\frac {A n}{1+n}\right ) \int \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \, dx \\ & = \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\left (C (1+\sec (c+d x))^{-n} (a+a \sec (c+d x))^n\right ) \int \sec ^{-n}(c+d x) (1+\sec (c+d x))^{1+n} \, dx+\left (\left (-C+\frac {A n}{1+n}\right ) (1+\sec (c+d x))^{-n} (a+a \sec (c+d x))^n\right ) \int \sec ^{-n}(c+d x) (1+\sec (c+d x))^n \, dx \\ & = \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {\left (C (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)\right ) \text {Subst}\left (\int \frac {(1-x)^{-1-n} (2-x)^{\frac {1}{2}+n}}{\sqrt {x}} \, dx,x,1-\sec (c+d x)\right )}{d \sqrt {1-\sec (c+d x)}}+\frac {\left (\left (-C+\frac {A n}{1+n}\right ) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)\right ) \text {Subst}\left (\int \frac {(1-x)^{-1-n} (2-x)^{-\frac {1}{2}+n}}{\sqrt {x}} \, dx,x,1-\sec (c+d x)\right )}{d \sqrt {1-\sec (c+d x)}} \\ & = \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}-\frac {\left (C-\frac {A n}{1+n}\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2}-n,-n,1-n,-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right ) \sec ^{1-n}(c+d x) \left (\frac {1+\sec (c+d x)}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a+a \sec (c+d x))^n \sin (c+d x)}{d n (1+\sec (c+d x))}+\frac {2^{\frac {3}{2}+n} C \operatorname {AppellF1}\left (\frac {1}{2},1+n,-\frac {1}{2}-n,\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d} \\ \end{align*}
\[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx \]
[In]
[Out]
\[\int \sec \left (d x +c \right )^{-1-n} \left (a +a \sec \left (d x +c \right )\right )^{n} \left (A +C \sec \left (d x +c \right )^{2}\right )d x\]
[In]
[Out]
\[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{-n - 1} \,d x } \]
[In]
[Out]
\[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int \left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{n} \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{- n - 1}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{-n - 1} \,d x } \]
[In]
[Out]
\[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{-n - 1} \,d x } \]
[In]
[Out]
Timed out. \[ \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx=\int \frac {\left (A+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n}{{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{n+1}} \,d x \]
[In]
[Out]